package com.cenwangkeji.resident.ui.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.cenwangkeji.resident.R;
import com.cenwangkeji.resident.model.Constant;
import com.cenwangkeji.resident.model.bean.CommunityNoticeBean;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lws.basic.utils.common.MyLogger;

import java.util.List;

/**
 * @松 on 2019/10/25 15:24
 * 社区公告适配器
 */
public class CommuntiyNoticeAdapter extends BaseQuickAdapter<CommunityNoticeBean.DataBean, BaseViewHolder> {
    public CommuntiyNoticeAdapter(@Nullable List<CommunityNoticeBean.DataBean> data) {
        super(R.layout.item_home_communtiy_notice, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CommunityNoticeBean.DataBean item) {

        helper.setText(R.id.tv_title, item.getTitle());
        helper.setText(R.id.tv_time,item.getCreateDate());
        Glide.with(mContext).load(Constant.base+item.getUrl()).apply(new RequestOptions().error(R.mipmap.ic_image_empty)).into((ImageView) helper.getView(R.id.iv));

    }
}
